/*
 * @Author: Dufen~123 dufen.0
 * @Date: 2024-12-25 16:03:58
 * @LastEditors: Dufen~123 dufen.0
 * @LastEditTime: 2024-12-25 16:09:51
 * @FilePath: \my-app\src\pages\ParentComponent3\index.js
 * @Description: 
 * */
import React, { useState } from 'react';
import ChildComponent from './components/ChildComponent3';

const ParentComponent = () => {
  const [message, setMessage] = useState('');

  const handleMessage = (msg) => {
    setMessage(msg);
  };

  return (
    <div>
      <h1>父组件3---子组件向父组件传递参数</h1>
      <p>从子组件接收到的消息: {message}</p>
      <ChildComponent handleMessage={handleMessage} />
    </div>
  );
};

export default ParentComponent;
